package ControlLayer;
import ModelLayer.Currency;
import DBLayer.DBCurrency;
import java.util.ArrayList;

public class CtrCurrency {
    // <editor-fold defaultstate="collapsed" desc="Attributes & Constructors">
    private static CtrCurrency instance = null;
    DBCurrency dbCurrency = new DBCurrency();

    public CtrCurrency() {
    }
    // </editor-fold>

    // <editor-fold defaultstate="collapsed" desc="Methods">
    public static CtrCurrency getInstance() {
        if (instance == null) {
            instance = new CtrCurrency();
        }
        return instance;
    }

    public ArrayList<Currency> getCurrencyList() {
        return dbCurrency.getCurrencyList();
    }

    public Currency getCurrencyByID(int id) {
        return dbCurrency.getCurrencyByID(id);
    }

    public int addCurrency(Currency currency) {
        return dbCurrency.addCurrency(currency);
    }

    public int updateCurrency(Currency currency, int id) {
        return dbCurrency.updateCurrency(currency, id);
    }

    public void deleteCurrency(int id) {
        dbCurrency.deleteCurrency(id);
    }
    // </editor-fold>
}
